if (rc > 0) then call displayerror(rc, 'GETCONFLIST:\n'BBSREAD.LASTERROR)
if (conflist.COUNT = 0) then do
reqnotify('No conferences created on this\nsystem. Using EMail as default.', 'Ok')
globalcfg.CONFERENCE = 'EMail'
end
else do
address(thorport)
'REQUESTLIST INSTEM 'conflist' TITLE "Select conference" SIZEGADGET'
if rc > 5 then call displayerror(rc, 'REQUESTLIST:\n'THOR.LASTERROR)
else if rc ~= 5 then globalcfg.CONFERENCE = result
end
drop conflist.
end
when choice = 2 then do
if reqnotify('Sort outgoing messages?\n\nWhen you send messages, a copy will by default be added\nto the database. If this option is active then messages\nthat do not match any triggers will be written to a\nconfigurable conference.') then do
call reqstring('Destination conference', 'Enter new conference name.\n\nThe new conference will be created\nwhen the configuration is saved.', 'Sent mail', 64, 1)
if ~(reqnotify('Auto configure.\n\nThis option will examine the message currently\ndisplayed in the Thor main window and try to\ncreate a new trigger based on the contents of\nthe message.\n\nCurrently it recognizes Aminet updates and\nsingle and digest messages from mailing lists.', 'Continue|Abort')) then return(0)
if (cursys.CONFNAME = '') then do
call reqnotify('You must enter a system and make sure a\nmessage is displayed in Thor''s main\nwindow before using auto configure.', 'Abort')
return(0)
end
'CURRENTMSG STEM 'curmsg
if (rc = 30) & (THOR.LASTERROR = 'No current message.') then do
call reqnotify('You must enter a system and make sure a\nmessage is displayed in Thor''s main\nwindow before using auto configure.', 'Abort')
drop THOR.LASTERROR
return(0)
end
if (rc ~= 0) then call displayerror(30, 'CURRENTSYSTEM: 'THOR.LASTERROR)
if (curmsg.CONFNAME ~= 'EMail') then do
call reqnotify('Auto config requires that the message you\nwant to examine is in the EMail conference.', 'Abort')
if (rc ~= 0) then call displayerror(rc, 'READBRMESSAGE:\n'BBSREAD.LASTERROR)
address(thorport)
/*
** Aminet daily and weekly mailings
*/
if (head.TOADDR = 'aminet-daily@wugate.wustl.edu') | (head.TOADDR = 'aminet-weekly@wugate.wustl.edu') then do
found = 1
if ~(reqnotify('Recognized message as an Aminet file index update.\n\nDo you want to add a trigger for adding the list\nof files in these messages to the file database?')) then return(0)
trigger.newtrig.name = 'Aminet update'
trigger.newtrig.groups = 'EMail'
trigger.newtrig.delmsg = 1
trigger.newtrig.deluser = 1
trigger.newtrig.matchall = 1
trigger.newtrig.nolocal = 0
trigger.newtrig.search.count = 1
trigger.newtrig.search.1.type = 'TOADDR'
trigger.newtrig.search.1.criteria = head.TOADDR
trigger.newtrig.search.1.not = 0
trigger.newtrig.action.count = 1
trigger.newtrig.action.1.type = 'RECENT'
trigger.newtrig.action.1.dontadd = 0
trigger.newtrig.action.1.checkdupes = 0
trigger.newtrig.action.1.nostats = 0
trigger.count = trigger.count + 1
signal acfini
end
/*
** Mailing lists
*/
if ~(found) then do
if (symbol('text.COMMENT.COUNT') = 'VAR') then if (text.COMMENT.COUNT > 0) then do i = 1 to text.COMMENT.COUNT while foundsrch = 0
if (upper(subword(text.COMMENT.i, 1, 1)) = 'RETURN-PATH:') then if (index(upper(subword(compress(text.COMMENT.i, '<'), 2, 1)), 'OWNER') > 0) | (index(upper(subword(compress(text.COMMENT.i, '<'), 2, 1)), 'REQUEST') > 0) | (index(upper(subword(compress(text.COMMENT.i, '<'), 2, 1)), 'BOUNCE') > 0) then do
/* Found "owner", "bounce" or "request" in Return-Path: header */
if ~(foundsrch) & (text.REPLYADDR = 'VAR') then do
if (symbol('text.PART.COUNT') = 'VAR') & (text.PART.COUNT > 0) then do
call reqnotify('This message contains more than one message part.\n\nIn order to set up a correct trigger I will have\nto know if this message is a digest message or a\nsingle, ordinary mailing list message.\n\nDigest messages are collections of messages posted\nto mailing list and are usually sent out once a\nday. SortMail can split digests into seperate\nmessages for easier reading.', 'Digest|_Single|Abort')
if (result = 0) then return(0)
if (result = 1) then isdigest = 1
end
end
if (foundsrch | foundmsg) & (symbol('trigger.newtrig.action.1.replyaddr') ~= 'VAR') then do
call reqnotify('I could not determine the address used for\nposting messages on the mailing list, nor\ncould I find any addresses used in this\nmessage. You will have to configure a\ntrigger for this mailing list yourself.', 'Ok')
return(0)
end
call reqnotify('I could not determine the address used for\nposting messages on the mailing list.\n\nNext a list of addresses given in this\nmessage will appear. Select the correct\none or, if you do not find it, cancel the\nrequester.', 'Ok')
call reqstring('Auto config', 'You can now create a trigger for moving messages\nposted to this mailing list to another conference.\n\nThe trigger name could for example be the address\nof the mailing list, which is what is suggested\nbelow. The name for the trigger will only be\nused to identify this particular trigger in\nCfgSortMail and the log.\n\nHit cancel if you do not want to create a new\ntrigger.', trigger.newtrig.action.1.replyaddr, 64, 1)
if (result = '') then do; found = 0; foundsrch = 0; drop trigger.newtrig.; signal mlfini; end
else trigger.newtrig.name = result
call reqstring('Auto config','Enter a name for the conference messages\nbelonging to this mailing list should be\ncopied to.', '(ML) ', 64, 1)
if (result = '') then do; found = 0; foundsrch = 0; drop trigger.newtrig.; signal mlfini; end
else trigger.newtrig.action.1.destconf = result
found = 1; trigger.count = newtrig
end
end
mlfini:
acfini:
if ~(found) then call reqnotify('This message did not contain any elements\nCfgSortMail recognized. A trigger will\nhave to be configured manually.', 'Ok')
else call reqnotify('The new trigger has been created. Please verify\nthat the information is correct by selecting\n"Edit trigger" in the main menu and then\n' || newtrig || '. ' || trigger.newtrig.name, 'Ok')
if temp.action.count > 0 then do i = 1 to temp.action.count
lno = aline + i
select
when temp.action.i.type = 'COPY' then do; menulist.lno = ' Copy message: To "'; if symbol('temp.action.i.destsys') = 'VAR' then menulist.lno = menulist.lno||temp.action.i.destsys': '; menulist.lno = menulist.lno||temp.action.i.destconf'"'; if symbol('temp.action.i.replyaddr') = 'VAR' then menulist.lno = menulist.lno', ReplyAddr "'temp.action.i.replyaddr'"'; end
when temp.action.i.type = 'RECENT' then do; menulist.lno = ' AmiNet RECENT: '; if temp.action.i.dontadd = 1 then menulist.lno = menulist.lno'Don''t add to database'; else do; menulist.lno = menulist.lno'Add to database, '; if temp.action.i.checkdupes = 1 then menulist.lno = menulist.lno'check for dupes. '; else menulist.lno = menulist.lno'don''t check for dupes. '; end; if temp.action.i.nostats = 1 then menulist.lno = menulist.lno'No MOTD & statistics'; else menulist.lno = menulist.lno'Show MOTD & statistics'; end
when temp.action.i.type = 'SAVEMESSAGE' then do; menulist.lno = ' Save message: '; if symbol('temp.action.i.filename') = 'VAR' then menulist.lno = menulist.lno'Filename "'temp.action.i.filename'"'; else menulist.lno = menulist.lno'Directory "'temp.action.i.directory'"'; end
when temp.action.i.type = 'SPLITDIGEST' then do; menulist.lno = ' Split digest: To "'temp.action.i.destconf'"'; if symbol('temp.action.i.replyaddr') = 'VAR' then menulist.lno = menulist.lno', ReplyAddr "'temp.action.i.replyaddr'"'; end
when temp.action.i.type = 'FORWARD' then do; menulist.lno = ' Forward message: To "'temp.action.i.sendto'" in "'temp.action.i.destconf'"'; if (symbol('temp.action.i.textfile') = 'VAR') then menulist.lno = menulist.lno || ', File "'temp.action.i.textfile'"'; end
when temp.action.i.type = 'MAIL' then do; menulist.lno = ' Mail text file: '; if (symbol('temp.action.i.sendto') = 'VAR') then menuist.lno = menulist.lno || 'To "'temp.action.i.sendto'" in '; else menulist.lno = menulist.lno || 'In '; menulist.lno = menulist.lno || '"'temp.action.i.destconf'", File "'temp.action.i.textfile'"'; end
when temp.action.i.type = 'EXTERNAL' then do; menulist.lno = ' Ext. script: Script name "'temp.action.i.scriptname'"'; if symbol('temp.action.i.scriptopts') = 'VAR' then menulist.lno = menulist.lno', Options "'temp.action.i.scriptopts'"'; end
if reqnotify('Are you sure you want to abort\nconfiguration of this trigger?') then do; drop temp.; return(0); end
end
when choice = 1 then temp.name = reqstring('Trigger name', 'Enter a name for the trigger.', addasterix(temp.name), 64)
when choice = 2 then temp.groups = reqstring('Search in', 'Enter the conference names to search\nin. If you want to search more than\none group, use an AmigaDOS pattern\nto limit your search.', addasterix(temp.groups), 256)
when choice = 4 then do
answer = reqnotify('Leave in EMail?\n\nIf you want a copy of messages processed by this\ntrigger to be left in the EMail conference, select "Yes".')
if answer = 0 then temp.DELMSG = 1; else temp.DELMSG = 0
end
when choice = 5 then do
answer = reqnotify('Add outgoing messages?\n\nBy default a local copy will be added to the\ndatabase when a message is sent. By selecting\n"No" local copies that match this trigger will\nnot be added to the database, nor will any of\nthe actions specified in this trigger be\nperformed on them.')
if answer = 0 then temp.NOLOCAL = 1; else temp.NOLOCAL = 0
end
when choice = 6 then do
answer = reqnotify('Add user?\n\nDo you want users sending mail processed by this\ntrigger to be added to the user database?')
if answer = 0 then temp.DELUSER = 1; else temp.DELUSER = 0
end
when choice = 7 then temp.MATCHALL = reqnotify('Match all criterias?\n\nIf you select yes, then all the configured search\ncriterias must be fulfilled for a message to be\nprocessed. Otherwise only one criteria will do.')
when choice = 9 then call cfgsearch(1)
when choice = 10 then call cfgaction(1)
when (choice = sline) | (choice = aline) then call reqnotify('Select an entry to\nedit or delete it.', 'I''ll do that')
when (choice > sline) & (choice < (aline - 1)) & (temp.search.count > 0) then do
call reqnotify('Do you want to edit or\ndelete this search entry?', 'Edit|_Delete|_Abort')
if result = 1 then call cfgsearch(2, (choice - sline))
else if result = 2 then call delsearch(choice - sline)
end
when (choice > aline) & (choice < (lno - 1)) & (temp.action.count > 0) then do
call reqnotify('Do you want to edit or\n delete this action entry?', 'Edit|_Delete|_Abort')
if result = 1 then call cfgaction(2, (choice - aline))
else if result = 2 then call delaction(choice - aline)
end
when choice = lno then do
if cfgtype = 1 then do; trigger.count = trigger.count + 1; org = trigger.count; end
when act = 1 then do; atemp.type = 'COPY'; atemp.destconf = ''; end
when act = 2 then do; atemp.type = 'RECENT'; atemp.checkdupes = 0; atemp.dontadd = 0; atemp.nostats = 0; end
when act = 3 then do; atemp.type = 'SAVEMESSAGE'; atemp.header = 0; atemp.append = 0; atemp.nobin = 0; end
when act = 4 then do; atemp.type = 'SPLITDIGEST'; atemp.destconf = ''; end
when act = 5 then do; atemp.type = 'FORWARD'; atemp.destconf = ''; atemp.sendto = ''; end
when act = 6 then do; atemp.type = 'MAIL'; atemp.destconf = ''; atemp.sendto = ''; atemp.textfie = ''; end
when act = 7 then do; atemp.type = 'EXTERNAL'; atemp.scriptname = ''; end
otherwise nop
end
drop act
end
if atype = 2 then call copystem(2, ano)
select
when atemp.type = 'COPY' then do
syschoice = getsystem()
if (syschoice ~= 0) then do
if (bbslist.syschoice ~= globalcfg.SYSTEM) then atemp.destsys = bbslist.syschoice
else atemp.destsys = globalcfg.SYSTEM
call getconference(atemp.destsys, 1)
if (result ~= 0) then do
if symbol('atemp.replyaddr') ~= 'VAR' then atemp.replyaddr = ''
atemp.replyaddr = reqstring('Reply address', 'Enter an address replies should be addressed to.\nA reply address is required if you use Local2Email.\nIf no reply address is given then replies will\nbe directed to the author or the address given\nin the Reply-To: header field. To do so, cancel\nthis requester.\n', addasterix(atemp.replyaddr), 64, 1, 'replyaddr')
if atemp.replyaddr = '' then drop atemp.replyaddr
end
else aborted = 1
end
else aborted = 1
end
when atemp.type = 'RECENT' then do
call reqnotify('Do you want to add new files to the file database?\nIf you select no, the new files will only be shown\nin the New Files window in Thor.')
if result = 1 then atemp.DONTADD = 0; else atemp.DONTADD = 1
if ~atemp.DONTADD then atemp.CHECKDUPES = reqnotify('Do you want to check for duplicates\nwhen adding files to the file database?\nThis will slow down operation.')
else drop atemp.CHECKDUPES
call reqnotify('Sometimes a message of the day and statistics\nare added to the listings. Do you want to display\nthese? Some of them may contain valuable info.')
if result = 1 then atemp.NOSTATS = 0; else atemp.NOSTATS = 1
end
when atemp.type = 'SAVEMESSAGE' then do
if reqnotify('Do you want to save to a specific\nfile or to a directory using the\nsubject as the file name?', 'File|_Directory') then do; drop atemp.directory; if symbol('atemp.filename') ~= 'VAR' then atemp.filename = ''; end
else do; drop atemp.filename; if symbol('atemp.directory') ~= 'VAR' then atemp.directory = ''; end
if symbol('atemp.filename') = 'VAR' then atemp.filename = result
else do
atemp.directory = result
if right(atemp.directory, 1) ~= '/' & right(atemp.directory, 1) ~= ':' then atemp.directory = atemp.directory || '/'
end
if symbol('atemp.directory') = 'VAR' then do
if reqnotify('Do you want to substitute part of the\nsubject with another string? This can\nbe done to shorten the filename of\nsaved messages in order to fit into\nAmigaDOS''s 35 character filename limit.') then do
if symbol('atemp.substitute') ~= 'VAR' then atemp.substitute = ''
atemp.substitute = reqstring('Substitute string', 'Enter the string you want to substitute.', addasterix(atemp.substitute), 256, 1)
if atemp.substitute = '' then drop atemp.substitute
else do
if symbol('atemp.with') ~= 'VAR' then atemp.with = ''
atemp.with = reqstring('Substitute with', 'Enter the string you want to substitute with.', addasterix(atemp.with), 256, 1)
if atemp.with = '' then drop atemp.substitute atemp.with
end
end
else drop atemp.substitute atemp.with
end
else drop atemp.substitute atemp.with
atemp.HEADER = reqnotify('Include header?\n\nDo you want to include\nheaders in the saved messages?')
atemp.APPEND = reqnotify('Append to file?\n\nDo you want to append messages if the\ndestination file already exists, then\nselect "YES". Otherwise the file\nwill be overwritten.')
if reqnotify('Save binaries?\n\nDo you want binary file parts to be copied\nto the download directory, then select "YES".\nOtherwise no action will be taken when a file\npart is found.') then atemp.nobin = 0; else atemp.nobin = 1
end
else aborted = 1
end
when atemp.type = 'SPLITDIGEST' then do
syschoice = getsystem()
if (syschoice ~= 0) then do
if bbslist.syschoice ~= globalcfg.SYSTEM then atemp.destsys = bbslist.syschoice
else atemp.destsys = globalcfg.SYSTEM
call getconference(atemp.destsys, 1)
if (result ~= 0) then do
if symbol('atemp.replyaddr') ~= 'VAR' then atemp.replyaddr = ''
atemp.replyaddr = reqstring('Reply address', 'Enter an address replies should be addressed to.\n\nIf no reply address is given then replies will\nbe directed to the author or the address given\nin the Reply-To: header field. To do so, cancel\nthis requester.', addasterix(atemp.replyaddr), 64, 1, 'replyaddr')
if atemp.replyaddr = '' then drop atemp.replyaddr
end
else aborted = 1
end
else aborted = 1
end
when atemp.type = 'FORWARD' then do
call getconference(globalcfg.SYSTEM, 0)
if (result ~= 0) then do
if (symbol('atemp.sendto') ~= 'VAR') then atemp.sendto = ''
atemp.sendto = reqstring('Send to', 'Enter an address the messages should\nbe forwarded to. (required)', addasterix(atemp.sendto), 64, 0)
if (atemp.sendto ~= '') then do
if (symbol('atemp.textfile') = 'VAR') then do
pathpart = getpathpart(atemp.textfile)
filepart = getfilepart(atemp.textfile)
end
else do
pathpart = ''
filepart = ''
end
call reqfile('Select text file to attach, cancel for none', pathpart, filepart, '#?')
if (result ~= '' & ~(right(result, 1) = '/' | right(result, 1) = ':')) then atemp.textfile = result; else drop atemp.textfile
end
else aborted = 1
end
else aborted = 1
end
when atemp.type = 'MAIL' then do
call getconference(globalcfg.SYSTEM, 0)
if (result ~= 0) then do
if (symbol('atemp.subject') ~= 'VAR') then atemp.subject = ''
atemp.subject = reqstring('Subject', 'Enter a message subject to beused for the mails. (required)', addasterix(atemp.subject), 256, 0)
if (atemp.subject ~= '') then do
if (symbol('atemp.textfile') = 'VAR') then do
pathpart = getpathpart(atemp.textfile)
filepart = getfilepart(atemp.textfile)
end
else do
pathpart = ''
filepart = ''
end
call reqfile('Select text file (required)', pathpart, filepart, '#?')
if (result ~= '' & ~(right(result, 1) = '/' | right(result, 1) = ':')) then do
atemp.textfile = result
if (symbol('atemp.sendto') ~= 'VAR') then atemp.sendto = ''
atemp.sendto = reqstring('Send to', 'Enter an address the messages\nshould be mailed to. If you do\nnot specify an address it will\nbe mailed to the sender of the\nmessage that caused the trigger.', addasterix(atemp.sendto), 64, 0)
if atemp.sendto = '' then drop atemp.sendto
end
else aborted = 1
end
else aborted = 1
end
else aborted = 1
end
when atemp.type = 'EXTERNAL' then do
if symbol('atemp.scriptname') ~= 'VAR' then atemp.scriptname = ''
filepart = getfilepart(atemp.scriptname)
pathpart = getpathpart(atemp.scriptname); if pathpart = '' then pathpart = thorpath'rexx'
if symbol('atemp.scriptopts') ~= 'VAR' then atemp.scriptopts = ''
atemp.scriptopts = reqstring('Script options', 'Enter the command line options that should be\npassed to the script. The following keywords\ncan be used:\n\n %%s returns the system name\n %%c returns the email conference name\n %%n returns the number of the message\n\nSortMail will add double quotes (") around %%s\nand %%c so don''t do that yourself, but make\nsure you seperate the items with a space.\n\nIf you don''t want to pass any options then\ncancel this requester.', addasterix(atemp.scriptopts), 256, 1)
if atemp.scriptopts = '' then drop atemp.scriptopts
end
else aborted = 1
end
otherwise nop
end
/* Update action stem */
if ~(aborted) then do
if atype = 1 then do; temp.action.count = temp.action.count + 1; ano = temp.action.count; end
call copystem(11,, ano)
end
drop atemp. ano pathpart filepart syschoice conflist. menulist. cno mcnt
when searchin = 1 then do; stemp.type = 'FROMADDR'; stemp.not = 0; end
when searchin = 2 then do; stemp.type = 'FROMADDR'; stemp.not = 1; end
when searchin = 3 then do; stemp.type = 'FROMNAME'; stemp.not = 0; end
when searchin = 4 then do; stemp.type = 'FROMNAME'; stemp.not = 1; end
when searchin = 5 then do; stemp.type = 'TOADDR'; stemp.not = 0; end
when searchin = 6 then do; stemp.type = 'TOADDR'; stemp.not = 1; end
when searchin = 7 then do; stemp.type = 'TONAME'; stemp.not = 0; end
when searchin = 8 then do; stemp.type = 'TONAME'; stemp.not = 1; end
when searchin = 9 then do; stemp.type = 'SUBJECT'; stemp.not = 0; end
when searchin = 10 then do; stemp.type = 'SUBJECT'; stemp.not = 1; end
when searchin = 11 then do; stemp.type = 'REPLYTO'; stemp.not = 0; end
when searchin = 12 then do; stemp.type = 'REPLYTO'; stemp.not = 1; end
when searchin = 13 then do; stemp.type = 'HEADER'; stemp.not = 0; end
when searchin = 14 then do; stemp.type = 'HEADER'; stemp.not = 1; end
when searchin = 15 then do; stemp.type = 'BODY'; stemp.not = 0; end
when searchin = 16 then do; stemp.type = 'BODY'; stemp.not = 1; end
otherwise nop
end
stemp.criteria = ''
if stemp.type = 'HEADER' then stemp.keyword = ''
drop searchin
end
if stype = 2 then call copystem(3, sno)
select
when stemp.type = 'FROMADDR' then where = 'from address'
when stemp.type = 'FROMNAME' then where = 'from name'
when stemp.type = 'TOADDR' then where = 'to address'
when stemp.type = 'TONAME' then where = 'to name'
when stemp.type = 'SUBJECT' then where = 'subject'
when stemp.type = 'REPLYTO' then where = 'reply-to'
when stemp.type = 'HEADER' then where = 'header'
when stemp.type = 'BODY' then where = 'message body'
otherwise stemp.type = '!unknown!'
end
if (symbol('stemp.pattern') = 'VAR') then newsearch = stemp.pattern
else newsearch = stemp.criteria
select
when stemp.type = 'HEADER' then do
stemp.keyword = addasterix(reqstring('Search keyword', 'Enter the first word on the\nheader line you want to search in.', addasterix(stemp.keyword), 64, 1, 'headline'))
if stemp.keyword = '' then signal bailout
newsearch = reqstring('Search criteria', 'Enter a string or a pattern to\nsearch for in the 'where'.', addasterix(newsearch), 64, 1, stemp.TYPE, 1)
if newsearch = '' then signal bailout
if left(newsearch, 1) = '02'x then do
stemp.pattern = substr(newsearch, 2); drop stemp.criteria
end
else do
stemp.criteria = substr(newsearch, 2); drop stemp.pattern
end
end
when stemp.type = 'BODY' then do
newsearch = reqstring('Search criteria', 'Enter a string or a pattern to\nsearch for in the 'where'.', addasterix(newsearch), 64, 0,, 1)
if newsearch = '' then signal bailout
if left(newsearch, 1) = '02'x then do
stemp.pattern = substr(newsearch, 2); drop stemp.criteria
end
else do
stemp.criteria = substr(newsearch, 2); drop stemp.pattern
end
drop stemp.keyword
end
otherwise do
newsearch = reqstring('Search criteria', 'Enter a string or a pattern to\nsearch for in the 'where'.', addasterix(newsearch), 64, 1, stemp.TYPE, 1)
if newsearch = '' then signal bailout
if left(newsearch, 1) = '02'x then do
stemp.pattern = substr(newsearch, 2); drop stemp.criteria
end
else do
stemp.criteria = substr(newsearch, 2); drop stemp.pattern
end
drop stemp.keyword
end
end
/* Update search stem */
if stype = 1 then do; temp.search.count = temp.search.count + 1; sno = temp.search.count; end
if symbol('globalcfg.LOCALTO') = 'VAR' then entry = entry' LOCALTO "'addasterix(globalcfg.LOCALTO)'"'
call writeln(cf, entry)
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
call writeln(cf, '')
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
if trigger.count > 0 then do i = 1 to trigger.count
'UPDATEPROGRESS 'progwin' CURRENT 'i
if rc ~= 0 then displayerror(rc, 'UPDATEPROGRESS:\n'THOR.LASTERROR'\nError while writing new configuration file.\nThe previous configuration will be used instead.')
entry = 'TRIGGER NAME "'addasterix(trigger.i.NAME)'"'
if ~((symbol('trigger.i.groups') ~= 'VAR') | (trigger.i.groups = '') | (trigger.i.groups = 'EMail')) then entry = entry' GROUPS "'addasterix(trigger.i.GROUPS)'"'
if trigger.i.delmsg then entry = entry' DELMSG'
if trigger.i.deluser then entry = entry' DELUSER'
if trigger.i.matchall then entry = entry' MATCHALL'
if trigger.i.nolocal then entry = entry' NOLOCAL'
call writeln(cf, entry)
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
if trigger.i.search.count > 0 then do j = 1 to trigger.i.search.count
entry = 'SEARCH 'trigger.i.search.j.type
if (symbol('trigger.i.search.j.not') = 'VAR') & (trigger.i.search.j.not = 1) then entry = entry' NOT'
if (symbol('trigger.i.search.j.criteria') = 'VAR') then entry = entry' SUBSTR "'addasterix(trigger.i.search.j.criteria)'"'
if (symbol('trigger.i.search.j.pattern') = 'VAR') then entry = entry' PATTERN "'addasterix(trigger.i.search.j.pattern)'"'
if (symbol('trigger.i.search.j.keyword') = 'VAR') then entry = entry' KEYWORD "'addasterix(trigger.i.search.j.keyword)'"'
call writeln(cf, entry)
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
end
if trigger.i.action.count > 0 then do j = 1 to trigger.i.action.count
entry = 'ACTION 'trigger.i.action.j.type
if symbol('trigger.i.action.j.destsys') = 'VAR' then entry = entry' DESTSYS "'addasterix(trigger.i.action.j.destsys)'"'
if symbol('trigger.i.action.j.destconf') = 'VAR' then entry = entry' DESTCONF "'addasterix(trigger.i.action.j.destconf)'"'
if symbol('trigger.i.action.j.replyaddr') = 'VAR' then entry = entry' REPLYADDR "'addasterix(trigger.i.action.j.replyaddr)'"'
if symbol('trigger.i.action.j.scriptname') = 'VAR' then entry = entry' SCRIPTNAME "'addasterix(trigger.i.action.j.scriptname)'"'
if symbol('trigger.i.action.j.scriptopts') = 'VAR' then entry = entry' SCRIPTOPTS "'addasterix(trigger.i.action.j.scriptopts)'"'
if symbol('trigger.i.action.j.filename') = 'VAR' then entry = entry' FILENAME "'addasterix(trigger.i.action.j.filename)'"'
if symbol('trigger.i.action.j.directory') = 'VAR' then entry = entry' DIRECTORY "'addasterix(trigger.i.action.j.directory)'"'
if symbol('trigger.i.action.j.substitute') = 'VAR' then entry = entry' SUBSTITUTE "'addasterix(trigger.i.action.j.substitute)'"'
if symbol('trigger.i.action.j.with') = 'VAR' then entry = entry' WITH "'addasterix(trigger.i.action.j.with)'"'
if symbol('trigger.i.action.j.sendto') = 'VAR' then entry = entry' SENDTO "'addasterix(trigger.i.action.j.sendto)'"'
if symbol('trigger.i.action.j.subject') = 'VAR' then entry = entry' SUBJECT "'addasterix(trigger.i.action.j.subject)'"'
if symbol('trigger.i.action.j.textfile') = 'VAR' then entry = entry' TEXTFILE "'addasterix(trigger.i.action.j.textfile)'"'
if trigger.i.action.j.header = 1 then entry = entry' HEADER'
if trigger.i.action.j.append = 1 then entry = entry' APPEND'
if trigger.i.action.j.nobin = 1 then entry = entry' NOBIN'
if trigger.i.action.j.dontadd = 1 then entry = entry' DONTADD'
if trigger.i.action.j.checkdupes = 1 then entry = entry' CHECKDUPES'
if trigger.i.action.j.nostats = 1 then entry = entry' NOSTATS'
call writeln(cf, entry)
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
/* Create conference and set appropriate flags if necessary */
if (symbol('trigger.i.action.j.destconf') = 'VAR') then do
newconf = trigger.i.action.j.destconf
if (symbol('trigger.i.action.j.destsys') = 'VAR') then newsys = trigger.i.action.j.destsys
if (rc ~= 0) then call displayerror(rc, 'CONFIGCONF: 'BBSREAD.LASTERROR'\nError while writing new configuration file.\nThe previous configuration will be used instead.')
if (rc ~= 0) then call displayerror(rc, 'GETCONFDATA: 'BBSREAD.LASTERROR'\nError while writing new configuration file.\nThe previous configuration will be used instead.')
if (confdata.CONFNETTYPE = CDNT_NONET) then do
'CONFIGCONF "'addasterix(newsys)'" "'addasterix(newconf)'" CONFNETTYPE 'CDNT_MAILFOLDER' SET 'c2x(CDF_NOT_ON_BBS)
if (rc ~= 0) then call displayerror(rc, 'CONFIGCONF: 'BBSREAD.LASTERROR'\nError while writing new configuration file.\nThe previous configuration will be used instead.')
end
address(thorport)
end
end
call writeln(cf, 'ENDTRIGGER')
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
call writeln(cf, '')
if rc ~= 0 then call displayerror(30, 'Error while writing new configuration file.\nThe previous configuration will be used instead.')
end
end
call close(cf)
if (exists('C:Copy') & exists('C:Delete')) then do
'OPENPROGRESS TITLE "CfgSortMail 'version'" TOTAL 'cfglength' PT "Reading configuration..."'
if rc ~= 0 then displayerror(rc, 'OPENPROGRESS:\n'THOR.LASTERROR'\nConfiguration not loaded.')
else progwin = result
cfgline = 0
address(bbsread)
do until seek(cf, 0) = cfglength
entry = readln(cf); cfgline = cfgline + 1
if symbol('progwin') = 'VAR' then do
address(thorport)
'UPDATEPROGRESS 'progwin' CURRENT 'seek(cf, 0)
if rc ~= 0 then displayerror(rc, 'UPDATEPROGRESS:\n'THOR.LASTERROR'\nConfiguration not loaded.')
address(bbsread)
end
select
when upper(subword(entry, 1, 1)) = "SYSTEM" then do
call reqnotify('Found old 2.x configuration file. SortMail has\nchanged the configuration file format in version\n3.0. A new one will have to be created from scratch.', 'Ok')
signal nocfg
end
when upper(subword(entry, 1, 1)) = "GLOBAL" then do
if (trigger.triggers.action.actions.type = 'MAIL') & ((symbol('trigger.triggers.action.actions.destconf') ~= 'VAR') | (symbol('trigger.triggers.action.actions.subject') ~= 'VAR') | (symbol('trigger.triggers.action.actions.textfile') ~= 'VAR')) then do
call displayerror(10, 'Error in 'cfgfile' line 'cfgline':\nMAIL action type incorrectly configured.\nConfiguration only partitially loaded.')
signal nocfg
end
if (trigger.triggers.action.actions.type = 'FORWARD') & ((symbol('trigger.triggers.action.actions.destconf') ~= 'VAR') | (symbol('trigger.triggers.action.actions.sendto') ~= 'VAR')) then do
call displayerror(10, 'Error in 'cfgfile' line 'cfgline':\nFORWARD action type incorrectly configured.\nConfiguration only partitially loaded.')
signal nocfg
end
end
when upper(subword(subentry, 1, 1)) = 'SEARCH' then do
if (symbol('trigger.triggers.search.searches.substr') = 'VAR') then do
trigger.triggers.search.searches.criteria = trigger.triggers.search.searches.substr; drop trigger.triggers.search.searches.substr
end
if ((symbol('trigger.triggers.search.searches.criteria') ~= 'VAR') & (symbol('trigger.triggers.search.searches.pattern') ~= 'VAR') | (symbol('trigger.triggers.search.searches.criteria') = 'VAR') & (symbol('trigger.triggers.search.searches.pattern') = 'VAR')) then do
call displayerror(10, 'Error in 'cfgfile' line 'cfgline':\nIllegal use of search parameters.\nConfiguration only partitially loaded.')
signal nocfg
end
end
when eof(cf) then do
call displayerror(10, 'Premature end of configuration file 'cfgfile'\nConfiguration only partitially loaded.')
signal nocfg
end
when upper(subword(subentry, 1, 1)) = 'TRIGGER' then do
call displayerror(10, 'TRIGGER did not contain ENDTRIGGER in 'cfgfile' line 'cfgline'\nConfiguration only partitially loaded.')
signal nocfg
end
otherwise nop
end
end
end
trigger.triggers.action.count = actions
trigger.triggers.search.count = searches
end
otherwise nop
end
trigger.count = triggers
end
end
else do
call reqnotify('Configuration file did not exist or\ncould not be opened.\n\nIf you are using SortMail for the first\ntime, please take a moment to read\nSortMail.guide which you can find in\nthe Docs directory.', 'Ok')
signal nocfg
end
if (symbol('globalcfg.CONFERENCE') ~= 'VAR') then do
globalcfg.SYSTEM = cursys.BBSNAME
globalcfg.CONFERENCE = 'EMail'
end
signal fini
nocfg:
drop globalcfg.; globalcfg.SYSTEM = cursys.BBSNAME; globalcfg.CONFERENCE = 'EMail'
drop trigger.; trigger.count = 0
fini:
if (cfgopen) then do
call close(cf)
address(thorport)
if symbol('progwin') = 'VAR' then do
'CLOSEPROGRESS REQ 'progwin
if rc ~= 0 then displayerror(rc, 'CLOSEPROGRESS:\n'THOR.LASTERROR)
/* Copy contents of original trigger stem to temporary trigger stem
Used when entering trigger configuration */
temp.name = trigger.fromnr.name
temp.delmsg = trigger.fromnr.delmsg
temp.deluser = trigger.fromnr.deluser
temp.matchall = trigger.fromnr.matchall
temp.nolocal = trigger.fromnr.nolocal
temp.groups = trigger.fromnr.groups
temp.action.count = trigger.fromnr.action.count
temp.search.count = trigger.fromnr.search.count
if trigger.fromnr.search.count > 0 then do i = 1 to trigger.fromnr.search.count
temp.search.i.type = trigger.fromnr.search.i.type
if symbol('trigger.fromnr.search.i.keyword') = 'VAR' then temp.search.i.keyword = trigger.fromnr.search.i.keyword; else drop temp.search.i.keyword
if symbol('trigger.fromnr.search.i.pattern') = 'VAR' then temp.search.i.pattern = trigger.fromnr.search.i.pattern; else drop temp.search.i.pattern
if symbol('trigger.fromnr.search.i.criteria') = 'VAR' then temp.search.i.criteria = trigger.fromnr.search.i.criteria; else drop temp.search.i.criteria
if symbol('trigger.fromnr.search.i.not') = 'VAR' then temp.search.i.not = trigger.fromnr.search.i.not; else drop temp.search.i.not
end
if trigger.fromnr.action.count > 0 then do i = 1 to trigger.fromnr.action.count
temp.action.i.type = trigger.fromnr.action.i.type
if symbol('trigger.fromnr.action.i.destconf') = 'VAR' then temp.action.i.destconf = trigger.fromnr.action.i.destconf; else drop temp.action.i.destconf
if symbol('trigger.fromnr.action.i.destsys') = 'VAR' then temp.action.i.destsys = trigger.fromnr.action.i.destsys; else drop temp.action.i.destsys
if symbol('trigger.fromnr.action.i.replyaddr') = 'VAR' then temp.action.i.replyaddr = trigger.fromnr.action.i.replyaddr; else drop temp.action.i.replyaddr
if symbol('trigger.fromnr.action.i.scriptname') = 'VAR' then temp.action.i.scriptname = trigger.fromnr.action.i.scriptname; else drop temp.action.i.scriptname
if symbol('trigger.fromnr.action.i.scriptopts') = 'VAR' then temp.action.i.scriptopts = trigger.fromnr.action.i.scriptopts; else drop temp.action.i.scriptopts
if symbol('trigger.fromnr.action.i.filename') = 'VAR' then temp.action.i.filename = trigger.fromnr.action.i.filename; else drop temp.action.i.filename
if symbol('trigger.fromnr.action.i.directory') = 'VAR' then temp.action.i.directory = trigger.fromnr.action.i.directory; else drop temp.action.i.directory
if symbol('trigger.fromnr.action.i.substitute') = 'VAR' then temp.action.i.substitute = trigger.fromnr.action.i.substitute; else drop temp.action.i.substitute
if symbol('trigger.fromnr.action.i.with') = 'VAR' then temp.action.i.with = trigger.fromnr.action.i.with; else drop temp.action.i.with
if symbol('trigger.fromnr.action.i.header') = 'VAR' then temp.action.i.header = trigger.fromnr.action.i.header; else drop temp.action.i.header
if symbol('trigger.fromnr.action.i.append') = 'VAR' then temp.action.i.append = trigger.fromnr.action.i.append; else drop temp.action.i.append
if symbol('trigger.fromnr.action.i.nobin') = 'VAR' then temp.action.i.nobin = trigger.fromnr.action.i.nobin; else drop temp.action.i.nobin
if symbol('trigger.fromnr.action.i.checkdupes') = 'VAR' then temp.action.i.checkdupes = trigger.fromnr.action.i.checkdupes; else drop temp.action.i.checkdupes
if symbol('trigger.fromnr.action.i.dontadd') = 'VAR' then temp.action.i.dontadd = trigger.fromnr.action.i.dontadd ; else drop temp.action.i.dontadd
if symbol('trigger.fromnr.action.i.nostats') = 'VAR' then temp.action.i.nostats = trigger.fromnr.action.i.nostats ; else drop temp.action.i.nostats
if symbol('trigger.fromnr.action.i.sendto') = 'VAR' then temp.action.i.sendto = trigger.fromnr.action.i.sendto ; else drop temp.action.i.sendto
if symbol('trigger.fromnr.action.i.subject') = 'VAR' then temp.action.i.subject = trigger.fromnr.action.i.subject ; else drop temp.action.i.subject
if symbol('trigger.fromnr.action.i.textfile') = 'VAR' then temp.action.i.textfile = trigger.fromnr.action.i.textfile ; else drop temp.action.i.textfile
end
end
if stemtype = 2 then do
/* Copy contents of action stem in temporary trigger stem to another temporary action stem
Used when entering action configuration */
atemp.type = temp.action.fromnr.type
if symbol('temp.action.fromnr.destconf') = 'VAR' then atemp.destconf = temp.action.fromnr.destconf; else drop atemp.destconf
if symbol('temp.action.fromnr.destsys') = 'VAR' then atemp.destsys = temp.action.fromnr.destsys; else drop atemp.destsys
if symbol('temp.action.fromnr.replyaddr') = 'VAR' then atemp.replyaddr = temp.action.fromnr.replyaddr; else drop atemp.replyaddr
if symbol('temp.action.fromnr.scriptname') = 'VAR' then atemp.scriptname = temp.action.fromnr.scriptname; else drop atemp.scriptname
if symbol('temp.action.fromnr.scriptopts') = 'VAR' then atemp.scriptopts = temp.action.fromnr.scriptopts; else drop atemp.scriptopts
if symbol('temp.action.fromnr.filename') = 'VAR' then atemp.filename = temp.action.fromnr.filename; else drop atemp.filename
if symbol('temp.action.fromnr.directory') = 'VAR' then atemp.directory = temp.action.fromnr.directory; else drop atemp.directory
if symbol('temp.action.fromnr.substitute') = 'VAR' then atemp.substitute = temp.action.fromnr.substitute; else drop atemp.substitute
if symbol('temp.action.fromnr.with') = 'VAR' then atemp.with = temp.action.fromnr.with; else drop atemp.with
if symbol('temp.action.fromnr.header') = 'VAR' then atemp.header = temp.action.fromnr.header; else drop atemp.header
if symbol('temp.action.fromnr.append') = 'VAR' then atemp.append = temp.action.fromnr.append; else drop atemp.append
if symbol('temp.action.fromnr.nobin') = 'VAR' then atemp.nobin = temp.action.fromnr.nobin; else drop atemp.nobin
if symbol('temp.action.fromnr.checkdupes') = 'VAR' then atemp.checkdupes = temp.action.fromnr.checkdupes; else drop atemp.checkdupes
if symbol('temp.action.fromnr.dontadd') = 'VAR' then atemp.dontadd = temp.action.fromnr.dontadd ; else drop atemp.dontadd
if symbol('temp.action.fromnr.nostats') = 'VAR' then atemp.nostats = temp.action.fromnr.nostats ; else drop atemp.nostats
if symbol('temp.action.fromnr.sendto') = 'VAR' then atemp.sendto = temp.action.fromnr.sendto ; else drop atemp.sendto
if symbol('temp.action.fromnr.subject') = 'VAR' then atemp.subject = temp.action.fromnr.subject ; else drop atemp.subject
if symbol('temp.action.fromnr.textfile') = 'VAR' then atemp.textfile = temp.action.fromnr.textfile ; else drop atemp.textfile
end
if stemtype = 3 then do
/* Copy contents of search stem in temporary trigger stem to another temporary search stem
Used when entering search configuration */
stemp.type = temp.search.fromnr.type
if symbol('temp.search.fromnr.keyword') = 'VAR' then stemp.keyword = temp.search.fromnr.keyword; else drop stemp.keyword
if symbol('temp.search.fromnr.pattern') = 'VAR' then stemp.pattern = temp.search.fromnr.pattern; else drop stemp.pattern
if symbol('temp.search.fromnr.criteria') = 'VAR' then stemp.criteria = temp.search.fromnr.criteria; else drop stemp.criteria
if symbol('temp.search.fromnr.not') = 'VAR' then stemp.not = temp.search.fromnr.not; else drop stemp.not
end
if stemtype = 10 then do
/* Copy contents of temporary trigger stem to original trigger stem
Used when exiting trigger configuration */
trigger.tonr.name = temp.name
trigger.tonr.delmsg = temp.delmsg
trigger.tonr.deluser = temp.deluser
trigger.tonr.matchall = temp.matchall
trigger.tonr.nolocal = temp.nolocal
trigger.tonr.groups = temp.groups
trigger.tonr.action.count = temp.action.count
trigger.tonr.search.count = temp.search.count
if temp.search.count > 0 then do i = 1 to temp.search.count
trigger.tonr.search.i.type = temp.search.i.type
if symbol('temp.search.i.criteria') = 'VAR' then trigger.tonr.search.i.criteria = temp.search.i.criteria; else drop trigger.tonr.search.i.criteria
if symbol('temp.search.i.keyword') = 'VAR' then trigger.tonr.search.i.keyword = temp.search.i.keyword; else drop trigger.tonr.search.i.keyword
if symbol('temp.search.i.pattern') = 'VAR' then trigger.tonr.search.i.pattern = temp.search.i.pattern; else drop trigger.tonr.search.i.pattern
if symbol('temp.search.i.not') = 'VAR' then trigger.tonr.search.i.not = temp.search.i.not; else drop trigger.tonr.search.i.not
end
if temp.action.count > 0 then do i = 1 to temp.action.count
trigger.tonr.action.i.type = temp.action.i.type
if symbol('temp.action.i.destconf') = 'VAR' then trigger.tonr.action.i.destconf = temp.action.i.destconf; else drop trigger.tonr.action.i.destconf
if symbol('temp.action.i.destsys') = 'VAR' then trigger.tonr.action.i.destsys = temp.action.i.destsys; else drop trigger.tonr.action.i.destsys
if symbol('temp.action.i.replyaddr') = 'VAR' then trigger.tonr.action.i.replyaddr = temp.action.i.replyaddr; else drop trigger.tonr.action.i.replyaddr
if symbol('temp.action.i.scriptname') = 'VAR' then trigger.tonr.action.i.scriptname = temp.action.i.scriptname; else drop trigger.tonr.action.i.scriptname
if symbol('temp.action.i.scriptopts') = 'VAR' then trigger.tonr.action.i.scriptopts = temp.action.i.scriptopts; else drop trigger.tonr.action.i.scriptopts
if symbol('temp.action.i.filename') = 'VAR' then trigger.tonr.action.i.filename = temp.action.i.filename; else drop trigger.tonr.action.i.filename
if symbol('temp.action.i.directory') = 'VAR' then trigger.tonr.action.i.directory = temp.action.i.directory; else drop trigger.tonr.action.i.directory
if symbol('temp.action.i.substitute') = 'VAR' then trigger.tonr.action.i.substitute = temp.action.i.substitute; else drop trigger.tonr.action.i.substitute
if symbol('temp.action.i.with') = 'VAR' then trigger.tonr.action.i.with = temp.action.i.with; else drop trigger.tonr.action.i.with
if symbol('temp.action.i.header') = 'VAR' then trigger.tonr.action.i.header = temp.action.i.header; else drop trigger.tonr.action.i.header
if symbol('temp.action.i.append') = 'VAR' then trigger.tonr.action.i.append = temp.action.i.append; else drop trigger.tonr.action.i.append
if symbol('temp.action.i.nobin') = 'VAR' then trigger.tonr.action.i.nobin = temp.action.i.nobin; else drop trigger.tonr.action.i.nobin
if symbol('temp.action.i.checkdupes') = 'VAR' then trigger.tonr.action.i.checkdupes = temp.action.i.checkdupes; else drop trigger.tonr.action.i.checkdupes
if symbol('temp.action.i.dontadd') = 'VAR' then trigger.tonr.action.i.dontadd = temp.action.i.dontadd ; else drop trigger.tonr.action.i.dontadd
if symbol('temp.action.i.nostats') = 'VAR' then trigger.tonr.action.i.nostats = temp.action.i.nostats ; else drop trigger.tonr.action.i.nostats
if symbol('temp.action.i.sendto') = 'VAR' then trigger.tonr.action.i.sendto = temp.action.i.sendto ; else drop trigger.tonr.action.i.sendto
if symbol('temp.action.i.subject') = 'VAR' then trigger.tonr.action.i.subject = temp.action.i.subject ; else drop trigger.tonr.action.i.subject
if symbol('temp.action.i.textfile') = 'VAR' then trigger.tonr.action.i.textfile = temp.action.i.textfile ; else drop trigger.tonr.action.i.textfile
end
end
if stemtype = 11 then do
/* Copy contents of temporary action stem to temporary trigger stem
Used when exiting action configuration */
temp.action.tonr.type = atemp.type
if symbol('atemp.destconf') = 'VAR' then temp.action.tonr.destconf = atemp.destconf; else drop temp.action.tonr.destconf
if symbol('atemp.destsys') = 'VAR' then temp.action.tonr.destsys = atemp.destsys; else drop temp.action.tonr.destsys
if symbol('atemp.replyaddr') = 'VAR' then temp.action.tonr.replyaddr = atemp.replyaddr; else drop temp.action.tonr.replyaddr
if symbol('atemp.scriptname') = 'VAR' then temp.action.tonr.scriptname = atemp.scriptname; else drop temp.action.tonr.scriptname
if symbol('atemp.scriptopts') = 'VAR' then temp.action.tonr.scriptopts = atemp.scriptopts; else drop temp.action.tonr.scriptopts
if symbol('atemp.filename') = 'VAR' then temp.action.tonr.filename = atemp.filename; else drop temp.action.tonr.filename
if symbol('atemp.directory') = 'VAR' then temp.action.tonr.directory = atemp.directory; else drop temp.action.tonr.directory
if symbol('atemp.substitute') = 'VAR' then temp.action.tonr.substitute = atemp.substitute; else drop temp.action.tonr.substitute
if symbol('atemp.with') = 'VAR' then temp.action.tonr.with = atemp.with; else drop temp.action.tonr.with
if symbol('atemp.header') = 'VAR' then temp.action.tonr.header = atemp.header; else drop temp.action.tonr.header
if symbol('atemp.append') = 'VAR' then temp.action.tonr.append = atemp.append; else drop temp.action.tonr.append
if symbol('atemp.nobin') = 'VAR' then temp.action.tonr.nobin = atemp.nobin; else drop temp.action.tonr.nobin
if symbol('atemp.checkdupes') = 'VAR' then temp.action.tonr.checkdupes = atemp.checkdupes; else drop temp.action.tonr.checkdupes
if symbol('atemp.dontadd') = 'VAR' then temp.action.tonr.dontadd = atemp.dontadd ; else drop temp.action.tonr.dontadd
if symbol('atemp.nostats') = 'VAR' then temp.action.tonr.nostats = atemp.nostats ; else drop temp.action.tonr.nostats
if symbol('atemp.sendto') = 'VAR' then temp.action.tonr.sendto = atemp.sendto ; else drop temp.action.tonr.sendto
if symbol('atemp.subject') = 'VAR' then temp.action.tonr.subject = atemp.subject ; else drop temp.action.tonr.subject
if symbol('atemp.textfile') = 'VAR' then temp.action.tonr.textfile = atemp.textfile ; else drop temp.action.tonr.textfile
end
if stemtype = 12 then do
/* Copy contents of temporary search stem to temporary trigger stem
Used when exiting action configuration */
temp.search.tonr.type = stemp.type
if symbol('stemp.keyword') = 'VAR' then temp.search.tonr.keyword = stemp.keyword; else drop temp.search.tonr.keyword
if symbol('stemp.pattern') = 'VAR' then temp.search.tonr.pattern = stemp.pattern; else drop temp.search.tonr.pattern
if symbol('stemp.criteria') = 'VAR' then temp.search.tonr.criteria = stemp.criteria; else drop temp.search.tonr.criteria
if symbol('stemp.not') = 'VAR' then temp.search.tonr.not = stemp.not; else drop temp.search.tonr.not
end
if stemtype = 20 then do
/* Copy contents of original trigger stem to a new stem number
Used when deleting of trigger, main menu and when rearranging triggers */
if symbol('trigger.fromnr.search.j.keyword') = 'VAR' then trigger.tonr.search.j.keyword = trigger.fromnr.search.j.keyword; else drop trigger.tonr.search.j.keyword
if symbol('trigger.fromnr.search.j.pattern') = 'VAR' then trigger.tonr.search.j.pattern = trigger.fromnr.search.j.pattern; else drop trigger.tonr.search.j.pattern
if symbol('trigger.fromnr.search.j.criteria') = 'VAR' then trigger.tonr.search.j.criteria = trigger.fromnr.search.j.criteria; else drop trigger.tonr.search.j.criteria
if symbol('trigger.fromnr.search.j.not') = 'VAR' then trigger.tonr.search.j.not = trigger.fromnr.search.j.not; else drop trigger.tonr.search.j.not
end
if trigger.fromnr.action.count > 0 then do j = 1 to trigger.fromnr.action.count
if symbol('trigger.fromnr.action.j.destconf') = 'VAR' then trigger.tonr.action.j.destconf = trigger.fromnr.action.j.destconf; else drop trigger.tonr.action.j.destconf
if symbol('trigger.fromnr.action.j.destsys') = 'VAR' then trigger.tonr.action.j.destsys = trigger.fromnr.action.j.destsys; else drop trigger.tonr.action.j.destsys
if symbol('trigger.fromnr.action.j.replyaddr') = 'VAR' then trigger.tonr.action.j.replyaddr = trigger.fromnr.action.j.replyaddr; else drop trigger.tonr.action.j.replyaddr
if symbol('trigger.fromnr.action.j.scriptname') = 'VAR' then trigger.tonr.action.j.scriptname = trigger.fromnr.action.j.scriptname; else drop trigger.tonr.action.j.scriptname
if symbol('trigger.fromnr.action.j.scriptopts') = 'VAR' then trigger.tonr.action.j.scriptopts = trigger.fromnr.action.j.scriptopts; else drop trigger.tonr.action.j.scriptopts
if symbol('trigger.fromnr.action.j.filename') = 'VAR' then trigger.tonr.action.j.filename = trigger.fromnr.action.j.filename; else drop trigger.tonr.action.j.filename
if symbol('trigger.fromnr.action.j.directory') = 'VAR' then trigger.tonr.action.j.directory = trigger.fromnr.action.j.directory; else drop trigger.tonr.action.j.directory
if symbol('trigger.fromnr.action.j.substitute') = 'VAR' then trigger.tonr.action.j.substitute = trigger.fromnr.action.j.substitute; else drop trigger.tonr.action.j.substitute
if symbol('trigger.fromnr.action.j.with') = 'VAR' then trigger.tonr.action.j.with = trigger.fromnr.action.j.with; else drop trigger.tonr.action.j.with
if symbol('trigger.fromnr.action.j.header') = 'VAR' then trigger.tonr.action.j.header = trigger.fromnr.action.j.header; else drop trigger.tonr.action.j.header
if symbol('trigger.fromnr.action.j.append') = 'VAR' then trigger.tonr.action.j.append = trigger.fromnr.action.j.append; else drop trigger.tonr.action.j.append
if symbol('trigger.fromnr.action.j.nobin') = 'VAR' then trigger.tonr.action.j.nobin = trigger.fromnr.action.j.nobin; else drop trigger.tonr.action.j.nobin
if symbol('trigger.fromnr.action.j.checkdupes') = 'VAR' then trigger.tonr.action.j.checkdupes = trigger.fromnr.action.j.checkdupes; else drop trigger.tonr.action.j.checkdupes
if symbol('trigger.fromnr.action.j.dontadd') = 'VAR' then trigger.tonr.action.j.dontadd = trigger.fromnr.action.j.dontadd ; else drop trigger.tonr.action.j.dontadd
if symbol('trigger.fromnr.action.j.nostats') = 'VAR' then trigger.tonr.action.j.nostats = trigger.fromnr.action.j.nostats ; else drop trigger.tonr.action.j.nostats
if symbol('trigger.fromnr.action.j.sendto') = 'VAR' then trigger.tonr.action.j.sendto = trigger.fromnr.action.j.sendto ; else drop trigger.tonr.action.j.sendto
if symbol('trigger.fromnr.action.j.subject') = 'VAR' then trigger.tonr.action.j.subject = trigger.fromnr.action.j.subject ; else drop trigger.tonr.action.j.subject
if symbol('trigger.fromnr.action.j.textfile') = 'VAR' then trigger.tonr.action.j.textfile = trigger.fromnr.action.j.textfile ; else drop trigger.tonr.action.j.textfile
end
end
if stemtype = 21 then do
/* Copy contents of temporary action stem to a new action stem number
Used when deleting action stem */
temp.action.tonr.type = temp.action.fromnr.type
if symbol('temp.action.fromnr.destconf') = 'VAR' then temp.action.tonr.destconf = temp.action.fromnr.destconf; else drop temp.action.tonr.destconf
if symbol('temp.action.fromnr.destsys') = 'VAR' then temp.action.tonr.destsys = temp.action.fromnr.destsys; else drop temp.action.tonr.destsys
if symbol('temp.action.fromnr.replyaddr') = 'VAR' then temp.action.tonr.replyaddr = temp.action.fromnr.replyaddr; else drop temp.action.tonr.replyaddr
if symbol('temp.action.fromnr.scriptname') = 'VAR' then temp.action.tonr.scriptname = temp.action.fromnr.scriptname; else drop temp.action.tonr.scriptname
if symbol('temp.action.fromnr.scriptopts') = 'VAR' then temp.action.tonr.scriptopts = temp.action.fromnr.scriptopts; else drop temp.action.tonr.scriptopts
if symbol('temp.action.fromnr.filename') = 'VAR' then temp.action.tonr.filename = temp.action.fromnr.filename; else drop temp.action.tonr.filename
if symbol('temp.action.fromnr.directory') = 'VAR' then temp.action.tonr.directory = temp.action.fromnr.directory; else drop temp.action.tonr.directory
if symbol('temp.action.fromnr.substitute') = 'VAR' then temp.action.tonr.substitute = temp.action.fromnr.substitute; else drop temp.action.tonr.substitute
if symbol('temp.action.fromnr.with') = 'VAR' then temp.action.tonr.with = temp.action.fromnr.with; else drop temp.action.tonr.with
if symbol('temp.action.fromnr.header') = 'VAR' then temp.action.tonr.header = temp.action.fromnr.header; else drop temp.action.tonr.header
if symbol('temp.action.fromnr.append') = 'VAR' then temp.action.tonr.append = temp.action.fromnr.append; else drop temp.action.tonr.append
if symbol('temp.action.fromnr.nobin') = 'VAR' then temp.action.tonr.nobin = temp.action.fromnr.nobin; else drop temp.action.tonr.nobin
if symbol('temp.action.fromnr.checkdupes') = 'VAR' then temp.action.tonr.checkdupes = temp.action.fromnr.checkdupes; else drop temp.action.tonr.checkdupes
if symbol('temp.action.fromnr.dontadd') = 'VAR' then temp.action.tonr.dontadd = temp.action.fromnr.dontadd ; else drop temp.action.tonr.dontadd
if symbol('temp.action.fromnr.nostats') = 'VAR' then temp.action.tonr.nostats = temp.action.fromnr.nostats ; else drop temp.action.tonr.nostats
if symbol('temp.action.fromnr.sendto') = 'VAR' then temp.action.tonr.sendto = temp.action.fromnr.sendto ; else drop temp.action.tonr.sendto
if symbol('temp.action.fromnr.subject') = 'VAR' then temp.action.tonr.subject = temp.action.fromnr.subject ; else drop temp.action.tonr.subject
if symbol('temp.action.fromnr.textfile') = 'VAR' then temp.action.tonr.textfile = temp.action.fromnr.textfile ; else drop temp.action.tonr.textfile
end
if stemtype = 22 then do
/* Copy contents of temporary search stem to a new search stem number
Used when deleting search stem */
temp.search.tonr.type = temp.search.fromnr.type
if symbol('temp.search.fromnr.keyword') = 'VAR' then temp.search.tonr.keyword = temp.search.fromnr.keyword; else drop temp.search.tonr.keyword
if symbol('temp.search.fromnr.pattern') = 'VAR' then temp.search.tonr.pattern = temp.search.fromnr.pattern; else drop temp.search.tonr.pattern
if symbol('temp.search.fromnr.criteria') = 'VAR' then temp.search.tonr.criteria = temp.search.fromnr.criteria; else drop temp.search.tonr.criteria
if symbol('temp.search.fromnr.not') = 'VAR' then temp.search.tonr.not = temp.search.fromnr.not; else drop temp.search.tonr.not
when ((createconf = 1) & (confchoice = 1)) then atemp.destconf = reqstring('Destination conference', 'Enter new conference name.\nThe new conference will be created\nby SortMail when the first message\nis copied to it.', addasterix(atemp.destconf), 64)
when ((createconf = 1) & (confchoice > 2)) then do; cno = confchoice - 2; atemp.destconf = conflist.cno; end
when ((createconf = 0) & (confchoice > 0)) then atemp.destconf = conflist.confchoice